/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network.packets;

/**
 *
 * @author Kvest
 */
public abstract class Packet 
{
    public static final int LOGIN_REQUEST = 1;
    public static final int LOGIN_RESPONCE = 2;
    public static final int DISTRICTS_UPDATE_SERVER_TIME = 3;
    public static final int DISTRICTS_UPDATE_SERVER_TIME_RESPONCE = 4;
    public static final int DISTRICTS_LIST_REQUEST = 5;
    public static final int DISTRICTS_LIST_RESPONCE = 6;
    public static final int MOVE_TODISTRICT_REQUEST = 7;
    public static final int MOVE_TODISTRICT_RESPONCE = 8;
    public static final int ORDERS_LIST_REQUEST = 9;
    public static final int ORDERS_LIST_RESPONCE = 10;
    public static final int ORDER_CHANGED = 11;
    public static final int GET_ORDER_REQUEST = 12;
    public static final int ORDER_YOUR_RESPONCE = 13;
    public static final int START_ORDER_RESPONCE = 14;   
    public static final int CHANGE_DRIVER_STATE_REQUEST = 15;
    public static final int CHANGE_DRIVER_STATE_RESPONCE = 16;
    public static final int CHANGE_DRIVER_STATE_FROM_SERVER = 17;
    public static final int CLOSE_RELAY_REQUEST = 18;
    public static final int DISTRICTS_STATISTIC_REQUEST = 19;
    public static final int DISTRICTS_STATISTIC_RESPONCE = 20;
    public static final int ORDER_DONE = 21;
    public static final int DISTRICT_CHANGED = 22;
    public static final int PING_REQUEST = 24;
    public static final int PING_RESPONCE = 25;
    public static final int ORDER_RECIEVED_RESPONCE = 26;
    public static final int DRIVERS_QUEUE_RESPONCE = 27;
    public static final int MY_INFO_REQUEST = 28;
    public static final int MY_INFO_RESPONCE = 29;
    public static final int AD_REQUEST = 30;
    public static final int AD_RESPONCE = 31;
    public static final int CALL_TO_ME_REQUEST = 32;
    public static final int CANCEL_ORDER_REQUEST = 33;
    public static final int CALL_TO_CLIENT_REQUEST = 34;
    public static final int SERVER_MESSAGE_RESPONCE = 35;
    public static final int EXIT_REQUEST = 36;
    public static final int ORDER_CANCEL_RESPONCE = 37;
    public static final int DRIVER_IN_BLACK_LIST_RESPONCE = 38;
    public static final int SET_ORDER_RESPONCE = 39;
    public static final int RECALL_REQUEST = 40;
    public static final int MESSAGES_ARCHIVE_REQUEST = 41;
    public static final int MESSAGES_ARCHIVE_RESPONCE = 42;
    public static final int SEND_MESSAGE_REQUEST = 43;
    public static final int MESSAGE_RESPONCE = 44;
    public static final int TIMER_CORRECTOR_RESPONCE = 45;
    public static final int ALERT_REQUEST = 46; 
    public static final int ORDER_REFUSE_REQUEST = 47; 
    
    protected int id;
    
    public Packet(int id, byte[] data)
    {
        this.id = id;
        parse(data);
    }
    
    protected abstract void parse(byte[] data);
    public abstract void print();
    
    public int getId() 
    {
        return id;
    }
    
    
}
